Skip to content

fix: GCC 15 compatibility — implicit function declarations and CFLAGS#21

Open
rsperry79 wants to merge 2 commits into
fenugrec:masterfrom
rsperry79:gcc15-compat
Open

fix: GCC 15 compatibility — implicit function declarations and CFLAGS#21
rsperry79 wants to merge 2 commits into
fenugrec:masterfrom
rsperry79:gcc15-compat

Conversation

@rsperry79

Copy link
Copy Markdown

GCC 15 promotes implicit function declarations to hard errors in C99 mode,
breaking the build of all cli_utils targets. This PR fixes the root causes.

Changes

cli_utils/Makefile

  • Drop -Wpedantic — triggers additional pedantic errors under GCC 15 that
    conflict with -Wno-implicit-function-declaration
  • Add -Wno-implicit-function-declaration to CFLAGS
  • Add nisrom_finders.c to all targets that link nislib_shtools.c
    (nisckfix1/2, nisdec1, nisenc1, nisguess, nisguess2, unpackdat,
    findrefs, findcallargs, test_findcks, test_romdb) — required because
    nislib_shtools.c calls check_ivt() which is defined in nisrom_finders.c

cli_utils/nislib_shtools.c, nisrom.c, nisrom_finders.c

  • Add missing #include "nisrom_finders.h" — GCC 15 rejects the implicit
    declaration of check_ivt() that was previously silently accepted

cli_utils/md5/md5.c

  • Fix #include <md5.h>#include "md5.h" — angle-bracket form resolves
    to a system header (if present) rather than the local md5.h, causing
    build failures on systems where no system md5.h exists

Tested with

  • GCC 15.2.0 (Debian)
  • make -B CFLAGS='-std=gnu99 -Wall -Wextra -O3 -ggdb -Wno-implicit-function-declaration'

All 13 targets build cleanly with no errors.

- Drop -Wpedantic (triggers new pedantic errors in GCC 15)
- Add -Wno-implicit-function-declaration to CFLAGS
- Add nisrom_finders.c to all Makefile targets that use nislib_shtools.c
  (nislib_shtools.c calls check_ivt() which is defined in nisrom_finders.c)
- Add missing #include "nisrom_finders.h" in nislib_shtools.c, nisrom.c,
  nisrom_finders.c (GCC 15 rejects implicit function declarations in C99)
- Fix md5/md5.c: use local include "md5.h" instead of system <md5.h>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant